#pragma once
#ifndef OBR_CAMERA_H
#define OBR_CAMERA_H

#include "Configurable.h"
#include "ProgramEntry.h"
#include "SharedDS/CameraData.h"
#include "VirtualProgramManager.h"
#include "common.h"
#include "helpers/Helpers.h"

namespace OBR
{
class Camera : public ProgramEntry
{
    /* -------------------------------- data -------------------------------- */
public:
    std::shared_ptr<CudaProgram> camera_program_group; // points to the program group created
    int medium_idx = -1;
    int med_id = -1, med_instance_id = 0;

private:
    /* ------------------------------- methods ------------------------------ */
public:
    Camera(std::string cuda_source_path);
    ~Camera();

    /**
     * @brief get program group of this type
     *
     * @return std::shared_ptr<CudaProgram>
     */
    std::shared_ptr<CudaProgram> getProgram() override;

    /**
     * @brief rotate camera around using given angle
     *
     * @param deg
     */
    virtual void rotate(float2 deg) = 0;

    /**
     * @brief translate camera using given direction
     *
     * @param dir
     */
    virtual void translate(float2 dir) = 0;

    /**
     * @brief zoom according to dist
     *
     * @param dist
     */
    virtual void zoom(float dist) = 0;

    /**
     * @brief link medium to this camera
     *
     * @param mediums
     */
    void linkMedium(VirtualProgramManager &mediums);

private:
    void setProgram(std::shared_ptr<CudaProgram> prog) override;
};

} // namespace OBR

#endif